<?php
$this->PhpExcel->Excel();
$this->PhpExcel->titulo_reporte("RRHH","MI TITULO");
$this->PhpExcel->titulo_hoja("titulo hoja");

$listadoReporte = array('normal' => 'Normal','detallado' => 'Detallado');
$ext = ($tipo == 1) ? 'xlsx' : 'ods';
$nombre = "LISTADO_MI_CASA_BIEN_EQUIPADA".date("d_m_Y");
	

$this->PhpExcel->hoja->getDefaultStyle()->applyFromArray(array('font' => array('name' => 'arial','size' => 10)));
$this->PhpExcel->hoja->getStyle('A1')->applyFromArray(array('font' => array('bold' => true, 'size' => 12, 'color' => array('rgb' => '8B0000'))));
$this->PhpExcel->hoja->getStyle('A2')->applyFromArray(array('font' => array('bold' => true, 'size' => 11)));
$this->PhpExcel->hoja->getStyle('A3')->applyFromArray(array('font' => array('bold' => false,'size' => 10)));
$this->PhpExcel->hoja->getStyle('A4')->applyFromArray(array('font' => array('bold' => false,'size' => 10)));

$arrStyleTitle = array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, 
																				 'startcolor' => array('rgb' => '04B486')),
				        												 'font' => array('bold' => true, 'color' => array('rgb' => PHPExcel_Style_Color::COLOR_WHITE)),
				        												 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER));

$arrStyleTitleuno = array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,
				                                    'startcolor' => array('rgb' => 'F5FBEF')));

$arrborderTitleuno = array('style' => PHPExcel_Style_Border::BORDER_DASHDOT,'color' => array('rgb' => '000000'));
			     
$this->PhpExcel->configura_celda('A',5); //#
$this->PhpExcel->configura_celda('B',5); //AG
$this->PhpExcel->configura_celda('C',30); //AGENCIA
$this->PhpExcel->configura_celda('D',5); //UO
$this->PhpExcel->configura_celda('E',35); //UNIDAD ORGANIZATIVA
$this->PhpExcel->configura_celda('F',7); //FICHA
$this->PhpExcel->configura_celda('G',25); //APELLIDO
$this->PhpExcel->configura_celda('H',25); //NOMBRE

$index_title=6;
$index_detail=0;

$j=0;
$tit = array('#','AG','AGENCIA','UO','UNIDAD ORGANIZATIVA','FICHA','APELLIDO','NOMBRE');
foreach($tit as $columnTitle)
{
		$this->PhpExcel->valor_celda($j, $index_title, $columnTitle);
		$oColumn = $this->PhpExcel->obtener_columna($j, $index_title);
		$oRow = $this->PhpExcel->obtener_fila($j, $index_title);
		$this->PhpExcel->hoja->getStyle($oColumn.$oRow)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
		$this->PhpExcel->hoja->getStyle($oColumn.$oRow)->applyFromArray($arrStyleTitle);
		$this->PhpExcel->hoja->getStyle($oColumn.$oRow)->getBorders()->getAllBorders()->applyFromArray( $arrborderTitleuno);
		$j++;
}


	
		

$this->PhpExcel->mostrar($nombre,$ext);
?>
